package nwpu.lizhiwen.system;

public class Team {
    private String teamId;
    private String teamName;
    private String department;
    private Student craetor;
    private Teacher teachers[] = new Teacher[10];
    private int teacherNumber = 0;
    private Student students[] = new Student[10];
    private int studentNumber = 0;
    private int count = 0;


    public void count1(){
        count++;
    }
    public void count2(){
        count--;
    }
    public int getCount() {
        return count;
    }

    public Teacher[] getTeachers() {
        return teachers;
    }

    public Student[] getStudents() {
        return students;
    }

    public Team(String teamId, String teamName, String department, Student craetor) {
        this.teamId = teamId;
        this.teamName = teamName;
        this.department = department;
        this.craetor = craetor;
    }

    public String getTeamId() {
        return teamId;
    }

    public String getTeamName() {
        return teamName;
    }

    public String getDepartment() {
        return department;
    }

    public Student getCraetor() {
        return craetor;
    }

    //此处添加方法逻辑相同，只对一处注释
    //该方法用于将学生添加入团队
    public void addStudent(Student student){
        if (studentNumber == students.length){
            return ;
        }
        //将传入的student赋给students数组
        students[studentNumber++] = student;
        System.out.println("添加成功");
    }
    public void addTeacher(Teacher teacher){
        if (teacherNumber == teachers.length){
            return ;
        }
        teachers[teacherNumber++] = teacher;
        System.out.println("添加成功");
    }
    @Override
    public String toString() {
        return  teamId + "_" + teamName +"_" + department +"_" + "_" +craetor.getId() ;
    }
}
